package srx.open.com.utils;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

/**
 * 
 * @author hailongqiu 356752238@qq.com
 *
 *         BCallAndroidUtils.openDialView(mContext, "13281002538");
 *         BCallAndroidUtils.openSmsView(mContext, "13281002538", "");
 */
public class BCallAndroidUtils {

	/*
	 * 打开拨号界面.
	 */
	public static void openDialView(Context context, String phoneNum) {
		Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"
				+ phoneNum));
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		context.startActivity(intent);
	}

	/*
	 * 打开短信界面.
	 */
	public static void openSmsView(Context context, String phoneNum,
			String content) {
		Uri smsToUri = Uri.parse("smsto:" + phoneNum);
		Intent intent = new Intent(Intent.ACTION_SENDTO, smsToUri);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent.putExtra("sms_body", content);
		context.startActivity(intent);
	}
}
